//
// Created by Wirano on 2020/11/10.
//

#ifndef DRV_TIME_H
#define DRV_TIME_H

#include "stm32f4xx_hal.h"

#define TICK_PER_SECOND	1000
#define TICK_US	(1000000/TICK_PER_SECOND)

typedef struct
{
	uint8_t init_flag;
	uint32_t old;
	uint32_t now;
	uint32_t dT;

}	_get_dT_st;

void TIM_INIT(void);
void sys_time(void);

uint16_t Get_Time(uint8_t,uint16_t,uint16_t);

uint32_t Get_Delta_T(_get_dT_st * );
uint32_t SysTick_GetTick(void);

void Cycle_Time_Init(void);

extern volatile uint32_t sysTickUptime;

void Delay_us(uint32_t);
void Delay_ms(uint32_t);
void SysTick_Configuration(void);
uint32_t GetSysTime_us(void);
void Ano_SysTick_Handler(void);

#endif //DRV_TIME_H
